import string
import os
import time
import types
import socket
import cPickle
import hashlib

import simplejson as json

from bsddb3 import db

"""
    Copyright (C) 2009,2010  Jorge Alegre Vilches

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
"""


class EnTableData(object):
	_Path = ''
	_NameList = []
	_ValueList = []
	_TableName = ''
	def __init__(self, **ArgsDict):
		"""Doc."""
		self._Path = ''
		self._NameList = []
		self._ValueList = []
		TupleList = ArgsDict.items()
		for Tuple in TupleList:
			name, value = Tuple
			DictTupleList = self.__dict__.items()
			for DictTuple in DictTupleList:
				dictName, dictValue = DictTuple
				try:
					if dictName.split('_')[1] == name:
						self.__setattr__(dictName, value)
				except IndexError:
					pass
	def getPath(self):
		"""Doc."""
		return self._Path
	def setPath(self, path):
		"""Doc."""
		self._Path = path
	def getNameList(self):
		"""Doc."""
		return self._NameList
	def setNameList(self, NameList):
		"""Doc."""
		self._NameList = NameList
	def getValueList(self):
		"""Doc."""
		return self._ValueList
	def setValueList(self, ValueList):
		"""Doc."""
		self._ValueList = ValueList
	Path = property(getPath, setPath, doc="Path, either real path of table name")
	NameList = property(getNameList, setNameList, doc="NameList")
	ValueList = property(getValueList, setValueList, doc="ValueList")
 